home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / mdmcomm1.zip / MDMCOMM.TXT < prev    next >
Text File  |  1993-04-04  |  17KB  |  412 lines

  1.                                                          Release 01/04/91
  2.  
  3. ================================================================================
  4. MdmComm - Modem Communications, a QuickBasic and Turbo Pascal Door Routine
  5.   By Darrell Ericson at Dare Devil BBS (603)429-2915 v1.00
  6. ================================================================================
  7. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  8.  
  9. o What IS MdmComm?  MdmComm is a modem communication door routine.  
  10.                 It is used for programmers who wish to write door games,
  11.         but do not really want to spend the time fooling with the
  12.         communications work.  MdmComm is a very simple communications
  13.         program.  I "whipped" this up in approximately no time, and
  14.         expect it to reflect my work.  <Grin> It currently only supports
  15.         Com1.  For door info files, it only supports DORINFO1.DEF
  16.         (QBBS/RBBS).  I plan to come out with a new version (v2.00) in
  17.         the future, which will support more Com ports.  Future versions
  18.         will possibly also support more door info files.  Possibly later
  19.         versions will also have routines for C and C++ programming.
  20.  
  21. o WHY was MdmComm?
  22.                 MdmComm was "whipped up" in a few hours, because there
  23.         did not seem to be any other modem Communications programs out
  24.         there.  I was sick and tired of trying to fool around and make
  25.         trash work, Turbo Pascal did not have any built in Communications
  26.         stuff, so I wrote a few routines in Assembly Language and called
  27.         them from Turbo Pascal, which seems to work out pretty good.
  28.         There are only basic communications stuff with MdmComm,
  29.         currently, but it's better than nothing.  Hopefully with the
  30.         stuff there you will be able to write something decent.  :)
  31.  
  32. o Legal stuff:
  33.                 IF you use MdmComm, you are using it at your own risk.  I
  34.         do not guarantee anything.  It works here, that's all I can say!
  35.         If you have any problems, contact my board at (603)429-2915.
  36.         Dare Devil BBS, and we will see what we can work out.
  37.  
  38. o Registering MdmComm:
  39.                 Registering MdmComm is ONLY $15!  What a deal!  In
  40.         MdmComm, nothing is disabled by not registering.  By registering,
  41.         that short pause at the beginning will be removed, and, you will
  42.         make me happy.  If you have problems with MdmComm,you are much
  43.         more likely to get me to fix them if you have registered it.
  44.  
  45. o About the author:
  46.                 I am Darrell Ericson of Dare Devil BBS (603)429-2915, I
  47.         live in Amherst, NH, and have lived here for 14 years.  I have
  48.         been programming for approximately a year.  I got my first modem
  49.         in Januaray of '90, and set up a BBS in Feb. of '90.  I have been
  50.         running a board ever since!  My first programming language was
  51.         Microsoft's QuickBasic 4.5, second I programmed in Borlands Turbo
  52.         Pascal 6.0, third I took a course on Assembly Language at Hesser
  53.         College in Nashua, NH.  After that I have been slowly using C,
  54.         and C++.  My favorite language by far is Borlands Turbo Pascal,
  55.         which I often mix with assembly language, as I did in MdmComm.  I
  56.         was born August 4th, 1976, and currently am 15 years old.  I
  57.         program whenever I have time, which is not often.  Some sports I
  58.         am into are biking, I am a member of the GSW (Granite State
  59.         Wheelmen), and I enjoy cross country running (5+ miles).  I am a
  60.         freshman at MASH (Milford Area Senior High) in Milford, NH.  I am
  61.         looking for some type of programming job, but am still kind of
  62.         young.  Maybe next year.  :)
  63.  
  64. o MdmComm Supports the following calls from Borlands Turbo Pascal 6.0:
  65.         Procedure InitComm;
  66.         Procedure DeInitComm;
  67.         Procedure ShowChar(Msg: String);
  68.         Procedure ShowCr(Msg: String);
  69.         Function UserKey: Char;
  70.         Function ReadChar(MaxChars: Byte): String;
  71.         Function Ready: Boolean;
  72.  
  73.         Procedure ClearKey;
  74.         Procedure ClrScrn;
  75.         Procedure AnyKey;
  76.         Procedure ShowFile(FileName: String);
  77.         Procedure Pause(Secs: Byte);
  78.  
  79. o MdmComm Supports the following calls from Microsoft QuickBasic 4.5:
  80.         SUB ClearKey ()
  81.         SUB ShowFile (FileName$)
  82.         SUB AnyKey ()
  83.         SUB ClrScrn ()
  84.         SUB Delay (Num!)
  85.         SUB InitComm ()
  86.         SUB DeInitComm ()
  87.         SUB ShowChar (Msg$)
  88.         SUB ShowCr (Msg$)
  89.         FUNCTION ReadChar$ (Num!)
  90.         FUNCTION UserKey$ ()
  91.  
  92. o MdmComm Supports the following calls from Microsoft Basic 7.1:
  93.         SUB ClearKey ()
  94.         SUB ShowFile (FileName$)
  95.         SUB AnyKey ()
  96.         SUB ClrScrn ()
  97.         SUB Delay (Num!)
  98.         SUB InitComm ()
  99.         SUB DeInitComm ()
  100.         SUB ShowChar (Msg$)
  101.         SUB ShowCr (Msg$)
  102.         FUNCTION ReadChar$ (Num!)
  103.         FUNCTION UserKey$ ()
  104.  
  105. o MdmComm has declared the following variables for you to use in
  106.      Borlands Turbo Pascal 6.0:
  107.         Remote: Boolean;
  108.         Graphics: Boolean;
  109.         Baud: Word;
  110.         UserName: String[30];
  111.         TimeLeft: Word;
  112.  
  113. o MdmComm has declared the following variables for you to use in
  114.      Microsoft QuickBasic 4.5:
  115.         True = -1, False = 0
  116.         Modem = 1
  117.         BBSName String * 30
  118.         SysOpName String * 30
  119.         UserName String * 30
  120.         UserCity String * 30
  121.         Graphics Integer
  122.         Remote Integer
  123.         Graphics Integer
  124.  
  125. o MdmComm has declared the following variables for you to use in
  126.      Microsoft Basic 7.1:
  127.         True = -1, False = 0
  128.         Modem = 1
  129.         BBSName String * 30
  130.         SysOpName String * 30
  131.         UserName String * 30
  132.         UserCity String * 30
  133.         Graphics Integer
  134.         Remote Integer
  135.         Graphics Integer
  136.  
  137. o Usage of Turbo Pascal Procedures and Functions:
  138.       Procedure InitComm;
  139.         Objective:      Initialize Modem, and read in dorinfo1.def
  140.         Example:        InitComm;
  141.         Comments:       This must be run before anything else.
  142.  
  143.       Procedure DeInitComm;
  144.         Objective:      Nothing
  145.         Example:        DeInitComm;
  146.         Comments:       This is just for compatibility with QB's version
  147.  
  148.       Procedure ShowChar(Msg: String);
  149.         Objective:      Display a string to com port and local screen
  150.                         without crlf appending string.
  151.         Example:        ShowChar(AnsiBBlue+'Hello!'+AnsiBWhite);
  152.         Comments:       See ShowCr
  153.  
  154.       Procedure ShowCr(Msg: String);
  155.         Objective:      Display a string to com port and local screen
  156.                         with crlf appending string.
  157.         Example:        ShowCr('MdmComm is great.');
  158.         Comments:       See ShowChar
  159.  
  160.       Function UserKey: Char;
  161.         Objective:      Read one character from com port or local keyboard
  162.                         with wait.
  163.         Example:        Ch := UserKey;
  164.         Comments:       Reads one character and does not wait for
  165.                         an enter key.  There is no time out.
  166.  
  167.       Function ReadChar(MaxChars: Byte): String;
  168.         Objective:      Read in a string of characters from com port
  169.                         or local keyboard.
  170.         Example:        String1 := ReadChar(10);
  171.         Comments:       Reads and echos characters, extended
  172.                         input (backspace works to delete chars)
  173.  
  174.       Function Ready: Boolean;
  175.         Objective:      Return if characters are waiting from
  176.                         com port or local keyboard.
  177.         Example:        If (Ready) then ShowCr('Chars are waiting!');
  178.         Comments:       None
  179.  
  180.       Procedure ClearKey;
  181.         Objective:      Clears all waiting characters from
  182.                         com port and local keyboard.
  183.         Example:        ClearKey;
  184.         Comments:       None
  185.  
  186.       Procedure ClrScrn;
  187.         Objective:      Clear screen for user through com port
  188.                         and local screen.
  189.         Example:        ClrScrn;
  190.         Comments:       None
  191.  
  192.       Procedure AnyKey;
  193.         Objective:      Prompt the user for Press [Any Key] To Continue...
  194.                         and wait for a key to be pressed.
  195.         Example:        AnyKey;
  196.         Comments:       shift and numlock, etc. Do not count as keys
  197.                         to be pressed.
  198.  
  199.       Procedure ShowFile(FileName: String);
  200.         Objective:      Show a file to the local user and remote user
  201.         Example:        ShowFile('THISFILE.TXT');
  202.         Comments:       It does not pause after each screen. Beware
  203.                         for long files.
  204.  
  205.       Procedure Pause(Secs: Byte);
  206.         Objective:      Delay the computer a bit.
  207.         Example:        Pause(1);
  208.         Comments:       1 = 1 second, 2 = 2 seconds, etc. Max = 255 seconds.
  209.  
  210. ===============================================================================
  211. |            End of Usage of Turbo Pascal Procedures and Functions.           |
  212. ===============================================================================
  213.  
  214. o Usage of Microsoft QuickBasic 4.5 Subs and Functions:
  215.       SUB ClearKey ()
  216.         Objective:      Clears all waiting characters from com port
  217.                         and local keyboard.
  218.         Example:        ClearKey
  219.         Comments:       None
  220.  
  221.       SUB ShowFile (FileName$)
  222.         Objective:      Display a .ASC/.ANS file to local screen and
  223.                         com port.
  224.         Example:        ShowFile("MDMCOMM1")
  225.         Comments:       If user has graphics it will show .ANS, otherwise
  226.                         .ASC
  227.  
  228.       SUB AnyKey ()
  229.         Objective:      Prompt user Press [Any Key] To Continue, and
  230.                         wait for keypress from com port or local
  231.                         keyboard.
  232.         Example:        AnyKey
  233.         Comments:       Shift and Numlock, etc. Do not count as keys.
  234.  
  235.       SUB ClrScrn ()
  236.         Objective:      Clears screen for user through com port and
  237.                         local screen.
  238.         Example:        ClrScrn
  239.         Comments:       It might help to have ansi.
  240.  
  241.       SUB Delay (Num!)
  242.         Objective:      Delays the computer a bit.
  243.         Example:        Delay(7)
  244.         Comments:       Delay 1 will delay 1 sec, delay 7, 10 secs, etc.
  245.                         Depending on computer.
  246.  
  247.       SUB InitComm ()
  248.         Objective:      Initialize Communications and read Dorinfo1.Def
  249.         Example:        InitComm
  250.         Comments:       This should proceed all other commands of MdmComm.
  251.                         Initializing the communications opens
  252.                         Com1 as file #1, so do not use file handle 1
  253.                         if you are using MdmComm.
  254.  
  255.       SUB DeInitComm ()
  256.         Objective:      Deinitialize Communications
  257.         Example:        DeInitComm
  258.         Comments:       This should be run last, MdmComm stuff does not
  259.                         work after this.
  260.  
  261.       SUB ShowChar (Msg$)
  262.         Objective:      Shows a string of characters to the com port
  263.                         without appending a crlf.
  264.         Example:        ShowChar("Hello!!!")
  265.         Comments:       See ShowCr
  266.  
  267.       SUB ShowCr (Msg$)
  268.         Objective:      Shows a string of characters to the com port
  269.                         appending it with a crlf
  270.         Example:        ShowCr("MdmComm is great.")
  271.         Comments:       See ShowChar
  272.  
  273.       FUNCTION ReadChar$ (Num!)
  274.         Objective:      Read in characters from com port and
  275.                         local keyboard.
  276.         Example:        String1$ = ReadChar$(10)
  277.         Comments:       It uses extended input, backspace works.
  278.         
  279.       FUNCTION UserKey$ ()
  280.         Objective:      Read in one character from com port or local
  281.                         keyboard.
  282.         Example:        Ch$ = UserKey$
  283.         Comments:       Returns one character, with wait
  284.  
  285. ===============================================================================
  286. |            End of Usage of Microsoft QuickBasic 4.5 Subs and Functions      |
  287. ===============================================================================
  288.  
  289. o Usage of Microsoft Basic 7.1 Subs and Functions:
  290.       SUB ClearKey ()
  291.         Objective:      Clears all waiting characters from com port
  292.                         and local keyboard.
  293.         Example:        ClearKey
  294.         Comments:       None
  295.  
  296.       SUB ShowFile (FileName$)
  297.         Objective:      Display a .ASC/.ANS file to local screen and
  298.                         com port.
  299.         Example:        ShowFile("MDMCOMM1")
  300.         Comments:       If user has graphics it will show .ANS, otherwise
  301.                         .ASC
  302.  
  303.       SUB AnyKey ()
  304.         Objective:      Prompt user Press [Any Key] To Continue, and
  305.                         wait for keypress from com port or local
  306.                         keyboard.
  307.         Example:        AnyKey
  308.         Comments:       Shift and Numlock, etc. Do not count as keys.
  309.  
  310.       SUB ClrScrn ()
  311.         Objective:      Clears screen for user through com port and
  312.                         local screen.
  313.         Example:        ClrScrn
  314.         Comments:       It might help to have ansi.
  315.  
  316.       SUB Delay (Num!)
  317.         Objective:      Delays the computer a bit.
  318.         Example:        Delay(7)
  319.         Comments:       Delay 1 will delay 1 sec, delay 7, 10 secs, etc.
  320.                         Depending on computer.
  321.  
  322.       SUB InitComm ()
  323.         Objective:      Initialize Communications and read Dorinfo1.Def
  324.         Example:        InitComm
  325.         Comments:       This should proceed all other commands of MdmComm.
  326.                         Initializing the communications opens
  327.                         Com1 as file #1, so do not use file handle 1
  328.                         if you are using MdmComm.
  329.  
  330.       SUB DeInitComm ()
  331.         Objective:      Deinitialize Communications
  332.         Example:        DeInitComm
  333.         Comments:       This should be run last, MdmComm stuff does not
  334.                         work after this.
  335.  
  336.       SUB ShowChar (Msg$)
  337.         Objective:      Shows a string of characters to the com port
  338.                         without appending a crlf.
  339.         Example:        ShowChar("Hello!!!")
  340.         Comments:       See ShowCr
  341.  
  342.       SUB ShowCr (Msg$)
  343.         Objective:      Shows a string of characters to the com port
  344.                         appending it with a crlf
  345.         Example:        ShowCr("MdmComm is great.")
  346.         Comments:       See ShowChar
  347.  
  348.       FUNCTION ReadChar$ (Num!)
  349.         Objective:      Read in characters from com port and
  350.                         local keyboard.
  351.         Example:        String1$ = ReadChar$(10)
  352.         Comments:       It uses extended input, backspace works.
  353.         
  354.       FUNCTION UserKey$ ()
  355.         Objective:      Read in one character from com port or local
  356.                         keyboard.
  357.         Example:        Ch$ = UserKey$
  358.         Comments:       Returns one character, with wait
  359.  
  360. ===============================================================================
  361. |            End of Usage of Microsoft Basic 7.1 Subs and Functions      |
  362. ===============================================================================
  363.  
  364. ================================================================================
  365. MdmComm - Modem Communications, a QuickBasic and Turbo Pascal Door Routine
  366.   By Darrell Ericson at Dare Devil BBS (603)429-2915 v1.00
  367. ================================================================================
  368. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  369.  
  370. Example (QuickBasic 4.5):
  371. ~~~~~~~
  372. '$INCLUDE:'MDMCOMM.BI'
  373. InitComm                
  374. ShowCr(AnsiBBlue+"H"+AnsiBWhite+"e"+AnsiYellow+"l"+AnsiBBlue+"l"+AnsiWhite+"o")
  375. DeInitComm
  376.  
  377. Example (Basic 7.1):
  378. ~~~~~~~
  379. '$INCLUDE:'MDMCOMM.BI'
  380. InitComm
  381. ClrScrn
  382. ShowCr(AnsiYellow+"What's up, doc?")
  383. DeInitComm
  384.  
  385. Example (Borlands Turbo Pascal 6.0):
  386. ~~~~~~~
  387. Program Example1;
  388.  
  389. Uses MdmComm;
  390.  
  391. Begin
  392.         InitComm;
  393.         ShowChar('Welcome to MdmComm, ', UserName, '...');
  394.         DeInitComm;
  395. End.
  396.  
  397. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  398.                                Extra Notes
  399. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  400. o MdmComm was WHIPPED up:
  401.                 MdmComm is not very refined or awesome yet, it was
  402.         WHIPPED UP over a few hours.  It could use A LOT more work.  If
  403.         anyone has any problems, or wants me to make some certain changes
  404.         to it, read in a different BBS type, or ANYTHING - call my board
  405.         and let me know.  That's Dare Devil BBS (603)429-2915!  I will
  406.         change just about anything-- Especially if you are one who has
  407.         registered.
  408.  
  409. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  410.                                   End of documentation
  411.                                   ~~~ ~~ ~~~~~~~~~~~~~
  412.